package tostring;
import java.util.*;
public class Person
{
	private String name;
	private boolean gender;
	private int age;
	private int id;
	public String getname() 
	{
		return name;
	}
	public void setname(String name) 
	{
		this.name = name;
	}
	public boolean getgender() 
	{
		return gender;
	}
	public void setgender(boolean name) 
	{
		this.gender = gender;
	}
	public int getage() 
	{
		return age;
	}
	public void setage(int age) 
	{
		this.age = age;
	}
	public int getid() 
	{
		return id;
	}
	public void setid(int id) 
	{
		this.id = id;
	}
	public Person()
    {
	System.out.println("This is constructor");
	System.out.println(name+","+age+","+gender+","+id);
    }
	public Person(String name,boolean gender,int age)
	{
		setname(name);
		setgender(gender);
		setage(age);
	}
	@Override
	public String toString()
	{
		return "Person [name="+name+", age="+age+", gender="+gender+", id="+id+"]";
	}
	public static void main(String[] args) {
		 Scanner in=new Scanner(System.in);
		 while(in.hasNext())
		 {
			 int n=in.nextInt();
			 Person[] p = new Person [n];
			 for(int i=0;i<n;i++)
			 {
				 String a=in.next();
				 int c=in.nextInt();
				 Boolean b=in.nextBoolean();
				 p[i]=new Person(a,b,c);
			 }
			 for(int i=n-1;i>=0;i--)
			 {
				 System.out.println(p[i]);
			 }
			 Person t=new Person();
			 System.out.println(t);
		 }
	 }
}